<extend name="Base/common"/>
<block name="body">
<style type="text/css">
.div-one{ margin: auto;width: 50%; margin-top: 50px;}
.div-one table tr td input{ margin-left: 50px; }
.div-one table tr td select{ margin-left: 50px; }
.div-one table tr{ 	display:block; margin:10px; }
#upload_picture_imgs{ background-color: red; }
.userverify{ width: 60%; height: 70%;}
</style>
<div class="div-one">
<a href="#" onClick="javascript :history.go(-1);">返回</a>
<form action="__CONTROLLER__/successful" method="post">
	<table>
		<tr><td>课酬：<span class="price"></span></td></tr>		
		<volist name="courses" id="v">
		<tr>
			<td><button type="button" class="title" data="{$v.salary}" value="{$v.id}">{$v.title}</button></td>
		</tr>
		</volist>
		<tr><td>课时数：<button type="button" class="minus">-</button><input class="num" name="num" value="" readonly="readonly"><button type="button" class="plus">+</button></tr>
		<tr><td>合计：<input class="sumprice" value="" name="price" readonly="readonly" /></td></tr>
		<tr><td>联系方式：</td></tr>
		<tr><td>微信：<input type="text" name="wechat" value="" /></td></tr>
		<tr><td>QQ：<input type="text" name="qq" value="" /></td></tr>
		<tr><td>手机号：<input type="text" name="mobile" value="{$user.mobile}" /></td></tr>
		<input type="hidden" name="id" value="" />
		<input type="hidden" name="title" value="" />
		<input type="hidden" name="tid" value="{$tid}" />
		<input type="hidden" name="account" value="{$user.account}" />
	</table>
	<button>提交</button>
</form>
</div>
<script>
	//选择课程，显示价格
	$('.title').click(function(){
		var price = $(this).attr('data');
		$('.title').css('background','').css('color','');
		$(this).css('background','orange').css('color','white');
		$('.price').val(price);
		$('.num').val(1);
		$('.sumprice').val(price);
		$('input[name=id]').val($(this).val());
		$('input[name=title]').val($(this).html());
	});

	//点击增加课时
	$('.minus').click(function(){
		changeSum(false);
	});
	//点击减少课时
	$('.plus').click(function(){
		changeSum(true);
	})
	function changeSum(flag){
		var num = parseInt($('.num').val());
		if (flag) {
			num++;
		} else {
			num = (num == 1) ? num : num-1;
		}
		$('.num').val(num);
		var price = $('.price').val();
		$('.sumprice').val(price*100*num/100);
	}

	$('.title:first').trigger('click');
</script>
</block>